package cmo.neutech.day15;
public class Text {
    public static int[] buff = new int[10];
    public static int count = 0;

    public static void main(String[] args) {
        producer p = new producer();
        customer c = new customer();

        Thread produce = new Thread(() -> {
           for (int i=0;i<20;i++){
               p.produce();
           }
        });

        Thread custome = new Thread(() -> {
            for (int i=0;i<20;i++){
                try {
                    c.custome();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });

        produce.start();
        custome.start();

        try {
            produce.join();
            custome.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
